package com.huaweicloud.sdk.drs.v5.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * 指定任务数据加工规则请求体
 */
public class DataProcessReq {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "data_process_info")

    private List<DataProcessInfo> dataProcessInfo = null;

    public DataProcessReq withDataProcessInfo(List<DataProcessInfo> dataProcessInfo) {
        this.dataProcessInfo = dataProcessInfo;
        return this;
    }

    public DataProcessReq addDataProcessInfoItem(DataProcessInfo dataProcessInfoItem) {
        if (this.dataProcessInfo == null) {
            this.dataProcessInfo = new ArrayList<>();
        }
        this.dataProcessInfo.add(dataProcessInfoItem);
        return this;
    }

    public DataProcessReq withDataProcessInfo(Consumer<List<DataProcessInfo>> dataProcessInfoSetter) {
        if (this.dataProcessInfo == null) {
            this.dataProcessInfo = new ArrayList<>();
        }
        dataProcessInfoSetter.accept(this.dataProcessInfo);
        return this;
    }

    /**
     * 指定任务数据加工规则请求体
     * @return dataProcessInfo
     */
    public List<DataProcessInfo> getDataProcessInfo() {
        return dataProcessInfo;
    }

    public void setDataProcessInfo(List<DataProcessInfo> dataProcessInfo) {
        this.dataProcessInfo = dataProcessInfo;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        DataProcessReq that = (DataProcessReq) obj;
        return Objects.equals(this.dataProcessInfo, that.dataProcessInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dataProcessInfo);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class DataProcessReq {\n");
        sb.append("    dataProcessInfo: ").append(toIndentedString(dataProcessInfo)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
